Technote TE 24 | June 1989 |
The nLines field gives the number of lines in the edit record, and the lineHeight field specifies the vertical distance from the ascent line from one line of text to the ascent line of the next line. In styled TextEdit, the lineHeight may vary for each line depending on the font and font size. These values are entries in the lineHeight table.
Figure 1-LineHeight
The product of the lineHeight (or the largest lineHeight value in styled TextEdit) and nLines gives a good approximation, in pixels, of the vertical dimension of the destRect of the TERec used. If this value is greater than 32,768, then unpredictable and erratic behavior may result.
For example:
2,400 lines of Chicago 12 point yields nLines = 2,400 and lineHeight = 16.
nLines * lineHeight = 2400 * 16 = 38,400. This is above the 32K limit.
1,200 lines of Times 24 point yields nLines = 1,200 and lineHeight = 30.
nLines * lineHeight = 1200 * 30 = 36,000. This is above the 32K limit.
In both of the examples above, the number of characters in the edit record was less than 32,768.
Both TELength and the size of the destRect must be under the
32K limit. You can compute an approximate vertical height of the
destRect by finding the product of nLines and
lineHeight (or the largest lineHeight value in styled
TextEdit).
Further Reference: